package com.tea.room.service.wechat;

import javax.servlet.http.HttpServletRequest;

import com.tea.room.model.Return;
import com.tea.room.model.tea.TeaOrder;

public interface PayService {

    /**
     * 支付下单
     * @param out_trade_no
     * @param total_fee
     * @return
     */
    Return getPayParams(String out_trade_no, String total_fee, String openid);
    
    /**
     * 关闭订单
     * @param request
     * @return
     */
    Return closeOrder(HttpServletRequest request);
    
    /**
     * 查询订单
     * @param request
     * @return
     */
    Return queryOrder(HttpServletRequest request);
    
    /**
     * 微信支付通知回调接口
     * @return
     */
    String weChatPayCallBack(HttpServletRequest request);
    
    /**
     * 微信退款通知回调接口
     * @return
     */
    String payRefundCallBack(HttpServletRequest request);
    
    /**
     * 申请退款
     * @param transaction_id 商户订单号
     * @param total_fee 退款金额
     * @return
     * @throws Exception
     */
    Return payRefund(String transaction_id, String total_fee) throws Exception;
    
    /**
     * 查询申请退款结果
     * @param transaction_id 商户订单号
     * @return
     * @throws Exception
     */
    Return queryRefund(String transaction_id) throws Exception;
    
    /**
     * 更新预定时间
     * @param order
     * @return 
     */
    String updateReserveTime(TeaOrder order);
    
    /**
     * 支付成功消息推送
     * @param order
     * @param flag
     * @param price
     * @param touser
     * @param password
     */
    void sendPaySuccessMesg(TeaOrder order, String flag, Object price, Object touser, String password);
    
    /**
     * 失败消息推送
     * @param touser
     */
    void sendFailMesg(Object touser);
    
}
